package com.wangwenshuo.goods.dao;

import com.wangwenshuo.goods.entity.Goods;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface GoodsMapper {
    List<Goods>selects(@Param("goods")Goods goods);

    @Delete("delete from goods where id in(${ids})")
    int del(@Param("ids") String ids);

    @Select("select * from goods where id=#{id}")
    Goods getById (@Param("id") Integer id);

    int insert(@Param("goods") Goods goods);

    int update(@Param("goods") Goods goods);
}
